package com.magicborrow.activity;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;

import com.magicborrow.R;

/**
 * Created by River on 7/4/16.
 */
public class MojieGongluActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.text_webview_activity);
        String  content = "<p class=\"p1\">\n" +
                "    <span class=\"s1\"><strong>1.</strong></span><span class=\"s2\"><strong>借用技巧</strong></span><span class=\"s1\">:</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">想要体验，发送借用申请－物主同意后，私信约定时间地点－支付租金与押金，（如约定时间地点不准确，请主动致电确认，避免影响借用）－到期时，请提前与物主确定好时间地点，按时归还，方便他人的同时保证自己的信用评级。－物主确定已归还，退还押金</span><span class=\"s1\">,</span><span class=\"s2\">获得租金</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class=\"s2\">－若发生损坏，物主与借用者协商赔偿，物主可申请索赔，借用者进行赔付（从押金中扣除，多退少补），索赔完成后，物主确定已完成。</span>\n" +
                "</p>\n" +
                "<p class=\"p2\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">2</span><span class=\"s2\">如何保障安全？</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s2\">&nbsp;2.1 &nbsp; </span><span class=\"s3\">双重保险：</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">&nbsp;</span><span class=\"s2\">－物主可设置押金保障物主物品的安全，防止损坏／丢失，某些物品需要一些押金。</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">&nbsp;</span><span class=\"s2\">－学号实名，同学之间更加借用更值得信赖。</span>\n" +
                "</p>\n" +
                "<p class=\"p2\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">2.2</span><span class=\"s2\">押金去哪儿？</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">－押金将由魔借平台暂时保管。借用结束，物主确认归还，押金将在</span><span class=\"s1\">24</span><span class=\"s2\">小时内退还。</span>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">2.3</span><span class=\"s2\">押金平台暂垫付规则：</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">为减轻借用用户临时高额押金支付压力，魔借将为用户暂时垫付部分押金，让用户更加轻松体验更多想要借用的物品。</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s3\">具体规则</span><span class=\"s2\">&nbsp; &nbsp; &nbsp; </span><span class=\"s3\">：</span><span class=\"s2\"> &nbsp; &nbsp; </span><span class=\"s3\">押金金额</span><span class=\"s2\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class=\"s3\">平台垫付</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s2\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100-1000</span><span class=\"s3\">；</span><span class=\"s2\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 70</span><span class=\"s3\">％；</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s2\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1000-3000 </span><span class=\"s3\">；</span><span class=\"s2\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 60%</span><span class=\"s3\">；</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s2\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3000-10000 </span><span class=\"s3\">；</span><span class=\"s2\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 70%</span><span class=\"s3\">；</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s2\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10000:</span><span class=\"s3\">－</span><span class=\"s2\">20000 </span><span class=\"s3\">；</span><span class=\"s2\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 30%</span>\n" +
                "</p>\n" +
                "<p class=\"p4\">\n" +
                "    <span class=\"s2\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;20000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class=\"s3\">暂不垫付</span>\n" +
                "</p>\n" +
                "<p class=\"p2\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p2\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">3.</span><span class=\"s2\">借用多久？</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">－物主上传物品时将设定一个借用时间，借用者可以按照此周期借用，也可与物主商量让其更改时间以及相应周期的租金额。</span>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">4.</span><span class=\"s2\">申请之后物主改变租金？</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">－申请之后租金依旧按申请时的租金计算，物主改定价格之后的申请将按新的租金计算。</span>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">5.</span><span class=\"s2\">为什么有两个信用评分？</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">－第一个借用信用评价是物主对借用者的借用行为的评价，每次评价级别由</span><span class=\"s1\">1-5</span><span class=\"s2\">，计算方法：（现评分＊现交易次数＋新评分）／现交易次数＋</span><span class=\"s1\">1</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">－第二个借出信用评价是借用者对物主借出行为的评价，每次评价级别由</span><span class=\"s1\">1-5</span><span class=\"s2\">，计算方法：（现评分＊现交易次数＋新评分）／现交易次数＋</span><span class=\"s1\">1</span>\n" +
                "</p>\n" +
                "<p class=\"p2\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s1\">6.</span><span class=\"s2\">已经支付后想要取消怎么办？</span>\n" +
                "</p>\n" +
                "<p class=\"p1\">\n" +
                "    <span class=\"s2\">－为了保障借物双方的利益，在借方支付后，任一方想要取消都要通过双方同意，方可取消。</span>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p class=\"p3\">\n" +
                "    <span class=\"s2\"></span><br/>\n" +
                "</p>\n" +
                "<p>\n" +
                "    <br/>\n" +
                "</p>";
        ((TextView)findViewById(R.id.title)).setText("魔借攻略");
        WebView webView = (WebView)findViewById(R.id.webView);
        webView.getSettings().setDefaultTextEncodingName("UTF -8");//设置默认为utf-8
        webView.loadData(content, "text/html; charset=UTF-8", null);//这种写法可以正确解码
        ((ImageView)findViewById(R.id.iv_back)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
